Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Argument target_group_arn should not be defined if listener type is forward and traffic needs to be routed to multiple target groups #300

Closed
wants to merge 1 commit into from

Conversation

romogo17
Copy link

Description

Fixes #299

Motivation and Context

Fixes bug that currently makes weighted target groups not to work as expected, documented more in-depth in the issue above.

Breaking Changes

No

How Has This Been Tested?

I have tested this module with a listener that is using weighted target groups, like the one provided in the examples

{
port = 81
protocol = "HTTP"
action_type = "forward"
forward = {
target_groups = [
{
target_group_index = 0
weight = 100
},
{
target_group_index = 1
weight = 0
}
]
}
},

Now, when more than 1 target group is defined, the default target_group_arn is removed, and the target groups are configured as expected in the forward block

      ~ default_action {
          - target_group_arn = "arn:aws:elasticloadbalancing:us-east-1:012345678912:targetgroup/MY-TARGET-GROUP-1/x0x0x0x0x0x0x" -> null
            # (2 unchanged attributes hidden)

          + forward {
              + stickiness {
                  + duration = 3600
                  + enabled  = true
                }

              + target_group {
                  + arn    = "arn:aws:elasticloadbalancing:us-east-1:012345678912:targetgroup/MY-TARGET-GROUP-1/x0x0x0x0x0x0x"
                  + weight = 100
                }
              + target_group {
                  + arn    = "arn:aws:elasticloadbalancing:us-east-1:012345678912:targetgroup/MY-TARGET-GROUP-2/x0x0x0x0x0x0x"
                  + weight = 0
                }
            }
        }

Further apply's don't keep on trying to configure the forward section indefinitely.

…s forward and traffic needs to be routed to a single target group
@romogo17 romogo17 changed the title fix: target_group_arn should only be specified in listeners if type is forward and traffic needs to be routed to a single target group fix: Argument target_group_arn should not be defined if listener type is forward and traffic needs to be routed to multiple target groups Jul 31, 2023
@romogo17
Copy link
Author

romogo17 commented Aug 4, 2023

@antonbabenko, @bryantbiggs, any chance you can help me with feedback for this fix? Thanks beforehand!

@github-actions
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Sep 11, 2023
@github-actions
Copy link

This PR was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this Sep 22, 2023
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weighted target groups don't work
1 participant